/**
 * @date 2017年7月11日
 * @Author SeppSong
 */
package com.zhys.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.zhys.dao.IUserDAO;
import com.zhys.model.UserDTO;
import com.zhys.service.ItestService;

/**
 * @author SeppSong
 *
 */
@Service("TestServiceImpl")
public class testServiceImpl implements ItestService{
	
	@Autowired
	@Qualifier("UserDAOImpl")
	private IUserDAO userDAOImpl;
	
	@Override
	public Map<String, Object> getUser(String userName) {
		Map<String, Object> resultMap = new HashMap<>();
		UserDTO userDTO = userDAOImpl.getUser(userName);
		
		if (userDTO == null) {
			return null;
		}
		resultMap.put("userId", userDTO.getId());
		resultMap.put("userName", userDTO.getUserName());
		resultMap.put("password", userDTO.getPassword());
		resultMap.put("random", userDTO.getRandom());
		resultMap.put("tel", userDTO.getTel());
		return resultMap;
	}

}
